package org.point.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.point.common.service.impl.BaseServiceImpl;
import org.point.common.util.DoPage;
import org.point.dao.TransactionRecordDao;
import org.point.domain.TransactionRecord;
import org.point.service.TransactionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("TransactionRecordService")
public class TransactionRecordServiceImpl extends BaseServiceImpl<TransactionRecord, Serializable>
		implements TransactionRecordService {

	@Autowired
	private TransactionRecordDao tDaoImpl;

	public List<TransactionRecord> searchTrandRecord(DoPage<TransactionRecord> page) {
		// TODO Auto-generated method stub
		return tDaoImpl.searchTrandRecord(page);
	}

	public Integer insertTrandRecord(TransactionRecord record) {
		// TODO Auto-generated method stub
		return tDaoImpl.insertTrandRecord(record);
	}

	public DoPage<TransactionRecord> searchTrandRecordPage(DoPage<TransactionRecord> page) {
		// TODO 获取交易数据page
		try {
			List<TransactionRecord> record = null;
			record = tDaoImpl.searchTrandRecord(page);
			Integer totalRecords = tDaoImpl.countTrandForMem(page);
			page.setList(record);
			page.setTotalRecords(totalRecords);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new RuntimeException("获取交易页面数据出错"+e);
		}
		return page;
	}

}
